// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import ElementUI from 'element-ui'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Qs from 'qs'

import App from './App'
import router from './router'
import '../static/UE/ueditor.config'
import '../static/UE/ueditor.all.min'
import '../static/UE/lang/zh-cn/zh-cn'
import '../static/UE/ueditor.parse.min'
/*
import {setSessionStorage} from 'common/js/utils'
import {errorCallback} from 'common/js/ajaxCallback'
*/

import 'element-ui/lib/theme-chalk/index.css'
import 'font-awesome/css/font-awesome.min.css'
import './common/css/common.css'
import './common/css/public.css'

Vue.use(VueAxios, axios)
Vue.use(ElementUI)

Vue.config.productionTip = false
Vue.prototype.$Qs = Qs

// 获取aseKey 和 token 值
/*
Vue.axios.get('/api/testCitys/getToken.do')
  .then(response => {
    let data = JSON.parse(response.data.data).data
    // console.log(data)
    setSessionStorage('data', data)
  })
  .catch(errorCallback)

// 获取 secret值
Vue.axios.get('/api/secret.do')
  .then(response => {
    let secretStr = response.data.secret
    // 截取secret前16位
    let secret = secretStr.substring(0, 16)
    setSessionStorage('secret', secret)
  })
  .catch(errorCallback)
*/

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
